package converter;

import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;

import util.MailTitleBody;

@Component
public class StringToMailTitleBodyConverter implements Converter<String, MailTitleBody> {

	@Override
	public MailTitleBody convert(String mtbString) {
		String[] titAndBody = mtbString.split("##");
		MailTitleBody mtb = new MailTitleBody(titAndBody[0], titAndBody[1]);
		return mtb;
	}

}
